<?php echo $this->inlineScript()->appendFile($this->baseUrl('/js/aplication/produto/Produto.js')) ; ?>

<div id="confirmDelete"></div>
<div class="grid_12">

    <div class="bottom-spacing">
        <!-- Button -->
        <div class="float-right">
            <a href="<?php echo $this->url(array('controller' => 'Produto', 'action' => 'add'), null, true); ?>" class="button" >
                <span>Adicionar
                    <img src="<?php echo $this->baseUrl() ?>/images/icon/plus-small.gif" tppabs="<?php echo $this->baseUrl() ?>/images/plus-small.gif" width="12" height="9" alt="Adicionar" />
                </span>
            </a>
        </div>

        <!-- Table records filtering -->
        Filtro:
        <select class="input-short">
            <option value="1" selected="selected">Selecione</option>
            <option value="2">Titulo</option>
            <option value="3">Comentário</option>
        </select>
    </div>
    <!-- Example table -->
    <div class="module">
        <h2><span>Produto</span></h2>
        <div class="module-table-body">
            <form action="">
                <table id="myTable" class="tablesorter">
                    <thead>
                        <tr>
                           <th style="width:5%">#</th>
                            <th style="width:20%">Codigo de Barra</th>
                            <th style="width:21%">Produto</th>
                            <th style="width:13%">Ref-Fabricante</th>
                            <th style="width:13%">Foto</th>
                            <th style="width:15%"></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($this->produto as $item): ?>

                            <tr>
                                <td class="align-center">
                                    <input type="checkbox" id="id[]" name="id[]" value="<?php echo $this->escape($item->id) ?>" />
                                </td>
                                <td><a href=""><?php echo $item->codBarras ?></a></td>
                                <td><?php echo $item->nome ?></td>
                                <td><?php echo $item->refFabricante ?></td>
                               <td align="center">
                                   <?php 
                                   echo $this->img($this->baseUrl().'/upload/produto/'.$item->foto, 100, 100, 'Foto'); ?>
                                </td>
                                <td>
                                    <a href="<?php echo $this->url(array('controller' => 'Produto', 'action' => 'show', 'id' => $item->id), null, true); ?>">
                                        <img src="<?php echo $this->baseUrl() ?>/images/icon/novo.gif" tppabs="<?php echo $this->baseUrl() ?>/images/icon/novo.gif" width="35" height="25" title="Show" alt="vizualizar" />
                                    </a>
                                    &ensp;
                                    <a href="<?php echo $this->url(array('controller' => 'Produto', 'action' => 'edit', 'id' => $item->id), null, true); ?>">
                                        <img src="<?php echo $this->baseUrl() ?>/images/icon/editar.gif" tppabs="<?php echo $this->baseUrl() ?>/images/icon/editar.gif" width="35" height="25" title="Editar" alt="Editar" />
                                    </a>
                                    &ensp;
                                    <a  onclick="confirmDelete('confirmDelete',base_url+'Produto/delete/id/','<?php echo $item->nome ;?>','<?php echo $item->id; ?>')" href="#">
                                        <img src="<?php echo $this->baseUrl() ?>/images/icon/deletar.gif" tppabs="<?php echo $this->baseUrl() ?>/images/icon/deletar.gif" width="35" height="25" title="Excluir" alt="Excluir" />
                                    </a>
                                </td>
                            </tr>
                         <?php endforeach; ?>
                        </tbody>
                    </table>
                </form>
            <?php echo $this->paginationControl($this->produto, 'Sliding', 'pagination.phtml'); ?>
        </div> <!-- End .grid_12 -->
        <div style="clear:both;"></div>
        <div style="clear:both;"></div>